package video;

import javax.microedition.amms.control.camera.CameraControl;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Item;
import javax.microedition.media.Manager;
import javax.microedition.media.Player;
import javax.microedition.media.control.VideoControl;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class Video extends MIDlet {
	Player player=null;
	VideoControl videoControl=null;
	Manager manager=null;
	CameraControl cameraControl=null;
	Form form=null;
	protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
		// TODO Auto-generated method stub

	}

	protected void pauseApp() {
		// TODO Auto-generated method stub

	}

	protected void startApp() throws MIDletStateChangeException {
		try {
			form=new Form("Capture");
			player=Manager.createPlayer("capture://video");
			player.realize();
			videoControl=(VideoControl)player.getControl("VideoControl");
//			cameraControl.
			form.append((Item)videoControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, null));
			player.start();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
